/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIBCOM_UTIL_H__
#define __LIBCOM_UTIL_H__

#include <String.hpp>
#include <windows.h>

namespace libcom
{

const String guid_to_string(const GUID & guid);

class ComInitializer
{
public:
	ComInitializer(){CoInitialize(0);}
	~ComInitializer(){CoUninitialize();}
};

//of cource, we have suppa-puppa mega converter,
//but it does not work, ha-ha-ha ;)


/*
template <class Interface> class com_ptr
{
public:
	
	com_ptr()
		: p(0)
	{}

	com_ptr(Interface * p)
		: p(p)
	{}

	~com_ptr()
	{
		this->Release();
	}

	void Release()
	{
		if(!p)
			return;

		p->Release();
		p = 0;
	}

	Interface * operator()() {return p;}

private:
	Interface * p;
};
*/

}//end of namespace

#endif

